//
//  main.m
//  TestNumber
//
//  Created by 曾泽昱 on 2024/7/10.
//

#import <Foundation/Foundation.h>
#import <Mansory/Mansory.h>
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
    }
    
//    NSNumber* intNumber =  [NSNumber numberWithInt:100];
//    NSNumber* floatNumber =  [NSNumber numberWithFloat:100.00];
//    
//    int myint = [intNumber intValue];
//    float myfloat = [floatNumber floatValue];
//    
//    if ([intNumber isEqualToNumber:floatNumber]) {
//        NSLog(@"相等");
//    }
//    else {
//        NSLog(@"不相等");
//    }
//    if ([intNumber compare:floatNumber] == NSOrderedSame){
//        NSLog(@"第一个数小于第二个数");
//    }
//    
//    NSComparisonResult compareResult;
    
    
//    NSArray* weeksName = [NSArray arrayWithObjects:@"周一",@"周二",@"周三",@"周四",@"周五",@"周六",nil];
//    NSLog(@"星期");
//    NSLog(@"==== ====");
//    int i = 0;
//    for (int i = 0;i < [weeksName count];++i){
//        NSLog(@"%3i        %@ ",i+1,[weeksName objectAtIndex: i]);
//    }
    
//    NSMutableArray* weekNames = [[NSMutableArray alloc] initWithCapacity:3];
//    [weekNames addObject:@"星期一"];
//    [weekNames addObject:@"星期二"];
//    [weekNames addObject:@"星期三"];
//    [weekNames addObject:@"星期四"];
//    [weekNames addObject:@"星期五"];
//    [weekNames addObject:@"星期六"];
    
//    NSArray* keys = [@"one two three four five" componentsSeparatedByString:@" "];
//    NSArray* values = [@"alpha bravo charlie delta echo" componentsSeparatedByString:@" "];
//    NSDictionary* dict = [[NSDictionary alloc] initWithObjects:values forKeys:keys];
//    
//    NSDictionary* dicts = [[NSDictionary alloc] initWithObjectsAndKeys:@"1",@"one",@"2",@"two",nil];
//    
//    NSLog(@"%@",[dicts description]);
//
//    NSMutableDictionary* mDict = [[NSMutableDictionary alloc] init];
//    [mDict setObject:@"rose" forKey:@"rose.com"];
//    [mDict setObject:@"tom" forKey:@"tom.com"];
//    
//    NSLog(@"%@",[mDict description]);
    
    
//    NSString* ID1 = [[NSString alloc] initWithString:@"220302197704230791"];
//    NSString* ID2 = [[NSString alloc] initWithString:@"221302197704230792"];
    
//    char buffer[20];
//    scanf("%s",buffer);
//    NSString* idINfo = [NSString stringWithUTF8String:buffer];
//    NSString* local = @"220302";
//    NSString* getIDLoca1 = [idINfo substringToIndex:6];
//    NSString* getIDSex = [idINfo substringFromIndex:[idINfo length]-1];
//    if ([getIDLoca1 isEqualToString:local] == YES){
//        NSLog(@"该ID是吉林人");
//    }
//    else {
//        NSLog(@"该ID不是吉林人");
//    }
//    int i = 9;
//    NSLog(@"i = %i",i);
//    if ([getIDSex isEqualToString:@"1"] == YES || [getIDSex isEqualToString:@"3"]){
//        NSLog(@"该ID是男性");
//    }
//    else{
//        NSLog(@"该ID是女性");
//    }
//    NSLog(@"i = %i",i);
    
    
    int number = 42;
    void (^printNumber)(void) = ^{
        NSLog(@"number = %i",number);
    };
    number = 44;
    printNumber();
    
    
    
    
    __block int number1 = 42; //通过引用捕获变量
    void (^printNumber1)(void) = ^{
        NSLog(@"number = %i",number);
    };
    number1 = 44;
    printNumber1();
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
  
    return 0;
}
